{layout name="common/base" }
<style>
    .order-status-txt{}
    .order-status-txt .unpay{
        padding:4px 8px;
        border-radius: 2px;
        color: white;
        background-color: #B42F2D;
    }
    .order-status-txt .payed{
        padding:4px 8px;
        border-radius: 2px;
        color: white;
        background-color: #AB956D;
    }
    .order-status-txt .delivery{
        padding:4px 8px;
        border-radius: 2px;
        color: white;
        background-color: #00A4F6;
    }
    .order-status-txt .done{
        padding:4px 8px;
        border-radius: 2px;
        color: white;
        background-color: #57AB53;
    }
    .order-status-txt .close{
        padding:4px 8px;
        border-radius: 2px;
        color: white;
        background-color: #000000;
    }
</style>
<div class="layui-form-item">
    <blockquote class="layui-elem-quote layui-text">基本信息
    <div class="layui-form" style="margin-top: 20px;">
        <table class="layui-table" style="table-layout: fixed;">
            <colgroup>
                <col width="100">
                <col width="150">
                <col width="150">
                <col width="150">
                <col width="100">
                <col width="100">
                <col width="200">
            </colgroup>
            <thead>
            <tr>
                <th>订单状态</th>
                <th>订单编号</th>
                <th>下单时间</th>
                <th>支付时间</th>
                <th>买家姓名</th>
                <th>买家电话</th>
                {if $data.trade_id == ''}
                {else /} <th>交易单号</th>
                {/if}
            </tr>
            </thead>
            <tbody>
            <tr>
                <td class="order-status-txt">
                    {if $data.order_status == 0}<span class="unpay">待付款</span>{/if}
                    {if $data.order_status == 1}<span class="payed">待发货</span>{/if}
                    {if $data.order_status == 2}<span class="delivery">已发货</span>{/if}
                    {if $data.order_status == 3}<span class="done">待评价</span>{/if}
                    {if $data.order_status == 4}<span class="done">已完成</span>{/if}
                    {if $data.order_status == -1}<span class="unpay">商家受理中</span>{/if}
                    {if $data.order_status == -2}<span class="unpay">退款完成</span>{/if}
                    {if $data.order_status == -3}<span class="unpay">商家拒绝退款</span>{/if}
                    {if $data.order_status == -4}<span class="unpay">取消交易</span>{/if}
                    {if $data.order_status == -5}<span class="close">交易关闭</span>{/if}
                    </span>
                </td>
                <td><?php echo $data['order_no'];?></td>
                <td><?php echo $data['create_time'];?></td>
                <td><?php echo date('Y-m-d H:i:s', $data['pay_time']);?></td>
                <td><?php echo $user['true_name'];?></td>
                <td><?php echo $user['mobile'];?></td>
                {if $data.trade_id == ''}
                {else /}
                <td><?php echo $data['trade_id'];?></td>
                {/if}
            </tr>
            </tbody>
        </table>
    </div>
    </blockquote>

    <blockquote class="layui-elem-quote layui-text">发货信息
        <div class="layui-form" style="margin-top: 20px;">
            <table class="layui-table" style="table-layout: fixed;">
                <colgroup>
                    <col width="150">
                    <col width="150">
                    <col width="300">
                    <col width="300">
                    <col width="300">
                </colgroup>
                <thead>
                <tr>
                    <th>收货人</th>
                    <th>收货电话</th>
                    <th>收货地址</th>
                    <th>买家留言</th>
                    <th>商家备注</th>
                </tr>
                </thead>
                <tbody>
                <tr>
                    <td><?php echo $order_address['name'];?></td>
                    <td><?php echo $order_address['mobile'];?></td>
                    <td><?php echo $order_address['province'].$order_address['city'].$order_address['country'].' '.$order_address['detail'];?></td>
                    <td>
                        {if $data.user_note == ''}无
                        {else /} {$data.user_note}
                        {/if}
                    </td>
                    <td>
                        {if $data.admin_note == ''}无
                        {else /} {$data.admin_note}
                        {/if}
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
    </blockquote>

    <blockquote class="layui-elem-quote layui-text">订单商品
    <div class="layui-form" style="margin-top: 20px;">
        <table class="layui-table" style="table-layout: fixed;">
            <colgroup>
                <col width="200">
                <col width="300">
                <col width="100">
                <col width="100">
                <col width="100">
            </colgroup>
            <thead>
            <tr>
                <th>商品名</th>
                <th>规格</th>
                <th>商品图</th>
                <th>商品单价</th>
                <th>购买数量</th>
                <th>商品总价</th>
            </tr>
            </thead>
            <tbody>
            {volist name="order_item" id="vo"}
            <tr>
                <td><?php echo $vo['name'];?></td>
                <td><?php echo $vo['props_text'];?></td>
                <td><img width="60px" height="40px"  onclick="showimg(this)" src="<?php echo config('setting.domain_prefix').config('setting.image_prefix').$vo['image'];?>"></td>
                <td><?php echo $vo['price'];?></td>
                <td><?php echo $vo['num'];?></td>
                <td><?php echo $vo['num']*$vo['price'];?></td>
            </tr>
            {/volist}
            <tr>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td></td>
                <td>商品总价：<?php echo $data['total_price'];?></td>
            </tr>
            </tbody>
        </table>

    </div>
    </blockquote>

    <blockquote class="layui-elem-quote layui-text">物流信息
        <div class="layui-form" style="margin-top: 20px;">
            <table class="layui-table" style="table-layout: fixed;">
                <?php if($data['order_status'] < 2):?>
                <colgroup>
                    <col width="200">
                </colgroup>
                <thead>
                <tr>
                    <th>无</th>
                </tr>
                </thead>
                <?php else:?>
                <colgroup>
                    <col width="200">
                    <col minWidth="300">
                </colgroup>
                <thead>
                <tr>
                    <th>快递公司</th>
                    <th>快递单号</th>
                </tr>
                </thead>
                <tbody>

                <tr>
                    <td><?php echo $data['delivery_name'];?></td>
                    <td><?php echo $data['delivery_no'];?></td>
                </tr>
                </tbody>

                <?php endif;?>
            </table>
        </div>
</div>

<script>
    /*查看图片*/
    function showimg(obj) {
        var img_infor = "<img src='" + obj.src + "'  width='800' height='400' />";
        layer.open({
        type: 1,
        closeBtn: 1,
        shade: false,
        title: false, //不显示标题
        skin: 'layui-layer-nobg', //没有背景色
        shadeClose: false,
        area:['800px','400px'],
        content: img_infor //捕获的元素，注意：最好该指定的元素要存放在body最外层，否则可能被其它的相对元素所影响

        });
    }
</script>